import Vue from 'vue'
import VueRouter from 'vue-router'
import CastH from '@/views/CastH'
import LoginH from '@/views/LoginH'
import MyH from '@/views/MyH'
import HouseH from '@/views/HouseH'
import IndexH from '@/views/IndexH'
import LayoutH from '@/views/LayoutH'
import RegisterH from '@/views/RegisterH'
import CollectH from '@/views/CollectH'
import RentH from '@/views/RentH'
import CityH from '@/views/CityH'
import GoRent from '@/views/GoRent'
import XiaoQu from '@/views/XiaoQu'
import MapH from '@/views/MapH'
import HouseDetail from '@/views/HouseDetail'
Vue.use(VueRouter)

const routes = [
  {
    path: '/housedeatil/:id',
    component: HouseDetail
  },
  {
    path: '/xiaoqu',
    component: XiaoQu
  },
  {
    path: '/logini',
    component: LoginH
  },
  {
    path: '/register',
    component: RegisterH
  },
  {
    path: '/map',
    component: MapH
  },
  {
    path: '/',
    component: LayoutH,
    redirect: '/indexi',
    // 二级路由
    children: [
      {
        path: '/housei/',
        component: HouseH
      },
      {
        path: '/casti',
        component: CastH
      },
      {
        path: '/indexi',
        component: IndexH
      },
      {
        path: '/myi',
        component: MyH
      }

    ]
  },
  {
    path: '/collect',
    component: CollectH
  },
  // 我的出租
  {
    path: '/rent',
    component: RentH
  },
  // 城市列表
  {
    path: '/city',
    component: CityH
  },
  {
    path: '/gorent',
    component: GoRent
  }

]

const router = new VueRouter({
  routes
})

export default router
